import { ProCard, ProColumns, ProTable } from "@ant-design/pro-components";

const App:React.FC=()=>{
     interface DataType{
        code?:string,name?:string,invstd?:string,status?:string,munit_name?:string,quantity?:number,type?:string,
        degree?:string,dep_name?:string,operater?:string,iszy?:string,device_code?:string,device_name?:string,
        ddate?:string,require_date?:string,
     };

     const columns:ProColumns<DataType>[]=[
        {dataIndex:'dep_name',title:'申请部门'},{dataIndex:'operater',title:'申请人'},
        {dataIndex:'code',title:'编码'},{dataIndex:'name',title:'名称'},
        {dataIndex:'invstd',title:'规格'},{dataIndex:'quantity',title:'数量'},
        {dataIndex:'require_date',title:'需求日期',valueType:'date'},{dataIndex:'degree',title:'优先级'},
        {dataIndex:'iszy',title:'是否专用'},{dataIndex:'device_code',title:'设备编码'},
        {dataIndex:'device_name',title:'设备名称'},{dataIndex:'ddate',title:'制单日期',valueType:'date'},
        
        {dataIndex:'status',title:'状态'},
     ];

     const tdata:DataType[]=[
        {dep_name:'机加工车间',operater:'李明慧',code:'A001',name:'XX齿轮',invstd:'50-52*80',status:'正常',
            quantity:5,require_date:'2025-3-5',degree:'A',iszy:'是',device_code:'D00263',device_name:'XXX加工中心',
            ddate:'2025-02-19',
        },
        {dep_name:'机加工车间',operater:'李明慧',code:'C02691',name:'XX轴',invstd:'20*56',status:'正常',
            quantity:5,require_date:'2025-3-5',degree:'A',iszy:'是',device_code:'D00263',device_name:'XXX加工中心',
            ddate:'2025-02-19',
        },
        {dep_name:'机加工车间',operater:'李明慧',code:'D06658',name:'绝缘软管',invstd:'30*100',status:'正常',
            quantity:5,require_date:'2025-3-5',degree:'B',iszy:'否',device_code:'',device_name:'',
            ddate:'2025-02-19',
        },
        {dep_name:'喷漆车间',operater:'张平',code:'Y6661',name:'油漆',invstd:'立邦10KG',status:'正常',
            quantity:5,require_date:'2025-3-10',degree:'A',iszy:'否',device_code:'',device_name:'',
            ddate:'2025-02-19',
        },
        {dep_name:'总装车间',operater:'柳青',code:'A001',name:'传输带',invstd:'90*200',status:'正常',
            quantity:5,require_date:'2025-3-1',degree:'A',iszy:'否',device_code:'',device_name:'',
            ddate:'2025-02-19',
        },
         
     ];

    return <>
         <ProCard title='备品备件采购申请' style={{height:700}}
         >
             <ProTable<DataType>
                search={false}
                options={false}
                columns={columns}
                dataSource={tdata}

                />
         </ProCard>
    </>;
};

export default App;